package com.sdy.service.Impl;

import com.sdy.dao.mysql.UserMapper;
import com.sdy.po.User;
import com.sdy.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    /**
     * 登录
     *
     * @param username
     * @param password
     * @return
     */
    @Override
    public User doLogin(String username, String password) {

        try {
            return userMapper.doLogin(username, password);
        } catch (Exception e) {
            return null;
        }
    }

    @Override
    public Boolean doRegist(String username, String password, String name) {
        try {
            userMapper.doRegist(username,password,name);
            return true;
        } catch (Exception e) {
            return false;
        }
    }
}


